<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: wickr_payload</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">wickr_payload</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__payload.html">wickr_payload</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The encrypted body content of a Wickr packet.  <a href="structwickr__payload.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad7d51d39a8477d87557536ff42399186"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__payload.html">wickr_payload_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__payload.html#gad7d51d39a8477d87557536ff42399186">wickr_payload_create</a> (<a class="el" href="structwickr__packet__meta.html">wickr_packet_meta_t</a> *meta, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *body)</td></tr>
<tr class="separator:gad7d51d39a8477d87557536ff42399186"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga96e1b0eabf307d112985946cbe2f6969"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__payload.html">wickr_payload_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__payload.html#ga96e1b0eabf307d112985946cbe2f6969">wickr_payload_copy</a> (const <a class="el" href="structwickr__payload.html">wickr_payload_t</a> *source)</td></tr>
<tr class="separator:ga96e1b0eabf307d112985946cbe2f6969"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga821c48aa748408e47ba2149e1628a487"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__payload.html#ga821c48aa748408e47ba2149e1628a487">wickr_payload_destroy</a> (<a class="el" href="structwickr__payload.html">wickr_payload_t</a> **payload)</td></tr>
<tr class="separator:ga821c48aa748408e47ba2149e1628a487"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga047613f464b15c627602399cd0c70c48"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__payload.html#ga047613f464b15c627602399cd0c70c48">wickr_payload_serialize</a> (const <a class="el" href="structwickr__payload.html">wickr_payload_t</a> *payload)</td></tr>
<tr class="separator:ga047613f464b15c627602399cd0c70c48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0965051bd564c60fa3f890185e271a2d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__payload.html">wickr_payload_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__payload.html#ga0965051bd564c60fa3f890185e271a2d">wickr_payload_create_from_buffer</a> (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer)</td></tr>
<tr class="separator:ga0965051bd564c60fa3f890185e271a2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7e4fd2ad4de22c2f7d6160400d2e15e7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__payload.html#ga7e4fd2ad4de22c2f7d6160400d2e15e7">wickr_payload_encrypt</a> (const <a class="el" href="structwickr__payload.html">wickr_payload_t</a> *payload, const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *payload_key)</td></tr>
<tr class="separator:ga7e4fd2ad4de22c2f7d6160400d2e15e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeeebf95ba580b92254a91009245028ee"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__payload.html">wickr_payload_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__payload.html#gaeeebf95ba580b92254a91009245028ee">wickr_payload_create_from_cipher</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *cipher_result, const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *payload_key)</td></tr>
<tr class="separator:gaeeebf95ba580b92254a91009245028ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga96e1b0eabf307d112985946cbe2f6969"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga96e1b0eabf307d112985946cbe2f6969">&#9670;&nbsp;</a></span>wickr_payload_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__payload.html">wickr_payload_t</a>* wickr_payload_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__payload.html">wickr_payload_t</a> *&#160;</td>
          <td class="paramname"><em>source</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy a payload</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td>the payload to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated payload holding a deep copy of the properties of 'source' </dd></dl>

</div>
</div>
<a id="gad7d51d39a8477d87557536ff42399186"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad7d51d39a8477d87557536ff42399186">&#9670;&nbsp;</a></span>wickr_payload_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__payload.html">wickr_payload_t</a>* wickr_payload_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__packet__meta.html">wickr_packet_meta_t</a> *&#160;</td>
          <td class="paramname"><em>meta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>body</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a payload from components</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">meta</td><td>see '<a class="el" href="structwickr__payload.html" title="The encrypted body content of a Wickr packet.">wickr_payload</a>' property documentation property documentation </td></tr>
    <tr><td class="paramname">body</td><td>see '<a class="el" href="structwickr__payload.html" title="The encrypted body content of a Wickr packet.">wickr_payload</a>' property documentation property documentation </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated payload owning the properties passed in </dd></dl>

</div>
</div>
<a id="ga0965051bd564c60fa3f890185e271a2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0965051bd564c60fa3f890185e271a2d">&#9670;&nbsp;</a></span>wickr_payload_create_from_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__payload.html">wickr_payload_t</a>* wickr_payload_create_from_buffer </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Deserialize a buffer into a payload</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>a buffer containing a payload serialized with 'wickr_payload_serialize' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a payload with data contained in 'buffer', or NULL if 'buffer' is not formatted properly </dd></dl>

</div>
</div>
<a id="gaeeebf95ba580b92254a91009245028ee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeeebf95ba580b92254a91009245028ee">&#9670;&nbsp;</a></span>wickr_payload_create_from_cipher()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__payload.html">wickr_payload_t</a>* wickr_payload_create_from_cipher </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td>
          <td class="paramname"><em>cipher_result</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td>
          <td class="paramname"><em>payload_key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decrypt-Then-Deserialize</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">engine</td><td>a crypto engine capable of decryption using payload_key </td></tr>
    <tr><td class="paramname">cipher_result</td><td>an encrypted payload </td></tr>
    <tr><td class="paramname">payload_key</td><td>the key to use for decrypting 'cipher_result' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a payload or NULL if an incorrect key is provided </dd></dl>

</div>
</div>
<a id="ga821c48aa748408e47ba2149e1628a487"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga821c48aa748408e47ba2149e1628a487">&#9670;&nbsp;</a></span>wickr_payload_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_payload_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__payload.html">wickr_payload_t</a> **&#160;</td>
          <td class="paramname"><em>payload</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy a payload</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">payload</td><td>a pointer to the payload to destroy. All properties of '*payload' will also be destroyed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga7e4fd2ad4de22c2f7d6160400d2e15e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7e4fd2ad4de22c2f7d6160400d2e15e7">&#9670;&nbsp;</a></span>wickr_payload_encrypt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a>* wickr_payload_encrypt </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__payload.html">wickr_payload_t</a> *&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td>
          <td class="paramname"><em>payload_key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Serialize-Then-Encrypt a payload</p>
<p>Payloads are serialized using protocol buffers (message.pb-c.h)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">payload</td><td>the payload to encrypt </td></tr>
    <tr><td class="paramname">engine</td><td>a crypto engine capable of encryption using payload_key </td></tr>
    <tr><td class="paramname">payload_key</td><td>the key to use for encryption </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an encrypted payload </dd></dl>

</div>
</div>
<a id="ga047613f464b15c627602399cd0c70c48"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga047613f464b15c627602399cd0c70c48">&#9670;&nbsp;</a></span>wickr_payload_serialize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>* wickr_payload_serialize </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__payload.html">wickr_payload_t</a> *&#160;</td>
          <td class="paramname"><em>payload</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Serialize a payload to a buffer</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">payload</td><td>the payload to serialize </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer containing the properties of 'payload' </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
